Skip to content

fix(metadata-protocol)!: the restore doors refuse the platform's own record, and the history selector refuses a package that neither holds nor ships the name - #37423

Merged
os-zhuang merged 7 commits into
mainfrom
claude/project-thread-fyj895
Nov 26, 2026
Merged

os-zhuang merged 7 commits into
mainfrom
claude/project-thread-fyj895

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #37130

Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: none — no skills/ page teaches the protocol's restore doors, the history ?package= selector or listPackageBindings

维护者速读

  • 用户能看到什么变化:环境管理员在历史版本里恢复或整批撤销时,平台自带的技能等记录不再被改写成旧版本,而是直接收到冲突提示和处理办法;按应用查看历史时,既没存过也没提供该名称的应用会被拒绝,不再串到环境自己的记录上。
  • 为什么做:这是「平台技能与应用技能分开存放」(云端技能注册)的收尾,补上协议层的两个恢复入口,并顺带修掉同一读取链上的三处小问题。
  • 出错会怎样:受影响的只是在环境里恢复平台自带记录旧版本、或按无关应用查历史的管理员,会收到冲突提示;改动可以直接撤回。
  • 要你做什么:无

What changes

  1. Card item 1 (R21). The metadata protocol's rollbackMetaItem and the restore limb of revertCommit refuse a restore whose row is the platform's own record, with the metadata service's rollback refusal: 409 RESOURCE_CONFLICT, its prescription, nothing written. One rule for the three doors: the refusal that lived privately in database-loader.ts is now refusePlatformRecordRestore(type, name, row), exported by @objectstack/metadata, asked by DatabaseLoader.registerRollback and by SysMetadataRepository.restoreVersion when a door passes refusePlatformRecord: true (both protocol restore doors do; the two undo writes do not). It is judged on the active row restoreVersion itself reads and writes. revertCommit puts the refused item in failed[] and reverts the commit's other items (ADR-0067 D3 as amended). The prescription now also names the environment's route (R23).
  2. Card item 2. historySlotOf (the history, diff and rollback doors' ?package= selector) refuses a package that neither holds a row of the name nor ships it with 409 not-held-by-qualifier, also when the name's package-less row is stored. Before, a read naming such a package fell back to the package-less row and the selector addressed that row. The package-less row is a package's slot only when the package ships the name (ADR-0150 D4).
  3. Card item 3 (R22, R23 nits in code). PLATFORM_PROVENANCE's doc names all three refused restore doors, words the snapshot rule exactly (the platform's own record's publish snapshot, served as the answer, keeps the mark at its top; a snapshot nested inside the answer never carries it) and names the two undo writes by what they undo. The stranded storedRowBodyOf doc comment in database-loader.ts sits on its function again.
  4. Folded (a). list() listed a stored row twice after the boot priming pass when its body's _packageId stamp differed from its package column. Measured: the loader keys the row by its column, and register(…, { skipSourceLoader: true }) filed the primed copy under the body's stamp. The fix is in neither list() nor the loader: the priming registration files such a stamped body under the column's slot (MetadataManager.primedRowSlot), so a primed process answers as an unprimed one does (one listing; a read naming the column's package answers it; the stamp's answers nothing).
  5. Folded (b) N2. Decision: fail closed. listPackageBindings is degraded, naming the loader, over a datasource: loader that offers no loadRowBindings. Reason: such a loader's items answer registration, which is not their rows' binding, and the spec contract already tells a gating consumer to treat a degraded answer as unknown, so this needs no contract change. No such loader ships in the tree.
  6. Folded (c) N7. Cheap fix, no cross-node coordination: bindReadRowPackage already re-reads the row; it now records the column as that re-read finds it, so the node whose boot pass lost the race answers the bound package instead of null until restart.
  7. R16 re-verified, no code. getPublished applies carriesPlatformStamp(item) to the top level only and strips every nested snapshot. Its four pins exist in database-loader.test.ts ("getPublished serves the mark on the top level only when the stored item carries it there").

ADR-0010 note, for the weekly ADR revisions card (out of this PR's file surface): the note should say "a restore whose row is the platform's own record is refused (409 RESOURCE_CONFLICT) at the metadata service's rollback and at the metadata protocol's rollbackMetaItem and the restore limb of revertCommit", in place of "a rollback whose row is the platform's own record is refused (409)".

Deliberate correction

check-empty-changeset is red by design on this PR: it rewrites one pending release note it did not add, because this PR made that note false.

  • Note: .changeset/37013-platform-skill-own-slot.md (pending, from fix(metadata): a skill the platform registers keeps its own slot beside an app's same-named skill #37021). Corrected at 43a6758f, three sentences; the rest of the bullet is byte-identical:
    1. Before: "…and so do the metadata protocol's save door and its restore doors (rollbackMetaItem and the restore limb of revertCommit);" After: "…and so do the metadata protocol's save door and its restore doors (rollbackMetaItem and the restore limb of revertCommit) on every restore whose row is not the platform's own record;"
    2. Before: "rollback whose row is the platform's own record is refused (409 RESOURCE_CONFLICT, naming the fix), with nothing written." After: "A restore whose row is the platform's own record is refused (409 RESOURCE_CONFLICT, naming the fix), with nothing written, at all three restore doors: rollback, and the metadata protocol's rollbackMetaItem and the restore limb of revertCommit."
    3. Before: "getPublished serves it on the answer's top level only when the stored item carries it there, and never inside a publish snapshot;" After: "getPublished serves it on the answer's top level only when the stored item carries it there (the platform's own record's publish snapshot, served as the answer, keeps the mark it carries at its top), and never on a snapshot nested inside the answer;"
  • Confirmation: the same-head contract review record at CONTRACT_REVIEW_TIER judges each rewritten sentence (pm-dispatch references/landing-operations.md); the seat's ACCEPT points to it.

Tests

Read first (by risk):

  1. packages/metadata-protocol/src/protocol-history-slots.ts — the holdsSlot line: the narrowing every ?package= history, diff and rollback request passes through.
  2. packages/metadata/src/metadata-manager.ts — primedRowSlot, the key a primed stored row is filed under.
  3. packages/metadata-protocol/src/sys-metadata-repository.ts — the refusePlatformRecord check inside restoreVersion.

New and changed pins:

  • protocol.platform-mark-rollback.test.ts, new describe: rollbackMetaItem refused 409 with the row byte-identical; revertCommit puts the item in failed[] (code RESOURCE_CONFLICT) and reverts the other item; RESTART: a process primed from the rows answers a read naming the one package holder with that holder's item and getPlatformItem with the platform's v2. Each was red on 5bf72422 before the door lines (expected { success: true, …(4) }, expected [] to have a length of 1, expected 'platform v1' to be 'package rules').
  • protocol-history-slots.test.ts: the case that pinned "P does not ship the name … the environment slot" is replaced by its refusal (the branch the ruling removes), plus a two-holder refusal and a .custom pair CONTROL.
  • protocol-diff-history-slots.33308.test.ts and the dogfood file history-diff-two-holders-33308.dogfood.test.ts: the case that addressed the environment's slot through a package shipping nothing now addresses it through a shipper (unit) or expects the 409 at the history and diff doors (dogfood).
  • database-loader.test.ts: (a) a new list() pin, and the 元数据读取:存储的元数据要能按行上记录的包读出绑定,不从正文推断 #37039 bindings case now expects differs once (it recorded the double listing); N2 and N7 pins.
Ablation (each fix line removed, then restored with git checkout)
Ablated line Red
refusePlatformRecord: true at rollbackMetaItem 1: the rollbackMetaItem pin
refusePlatformRecord: true at revertCommit 2: the revertCommit pin and the RESTART pin
the check in restoreVersion 3: all three door pins
holdsSlot = slot !== null && … back to slots.includes(slot) 3: two selector pins and the 33308 diff case
primedRowSlot not passed to writeRegistryEntry 2: the new list() pin and the #37039 bindings case
N2 degraded = true 1: the N2 pin
N7 column record after the re-read 1: the N7 pin
refusePlatformRecordRestore answering nothing 2: the service rollback pins of #37013
Package runs
  • pnpm --filter @objectstack/metadata test at abc706ce: Test Files 83 passed (83), Tests 2808 passed (2808).
  • pnpm --filter @objectstack/metadata --filter @objectstack/metadata-protocol typecheck at abc706ce: both Done, exit 0.
  • pnpm --filter @objectstack/metadata-protocol test at 955a3452 (the last commit touching either package before the changeset and the merge of main, which touched neither): Test Files 370 passed, 9 skipped (379); Tests 23440 passed, 45 skipped (23485). Re-run at abc706ce under the verify lock: same counts, command exit 0. pnpm --filter @objectstack/dogfood test at abc706ce under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); exit 0.

Acceptance notes

  • Declaration: the claim reads Clause-②: no (narrowing…). The diff also widens the public surface (the refusePlatformRecordRestore export and the refusePlatformRecord option of restoreVersion), so it declares yes (narrowing).
  • The unreleased .changeset/37013-platform-skill-own-slot.md still carries two of round 4's texts (R22 c and d: "of a failed batch row write", and the protocol doors reading the mark's one definition) and "never inside a publish snapshot". That file is outside this claim's file surface; carrier: the seat, as a deliberate correction with the next text edit.
  • Round 4's R21 paragraph also named one more reading (a version the platform registered is attributed to the environment in history, so after the platform withdraws its record under a one-holder name a rollback naming the package can write it into the package's row). Not in this claim's scope and not changed here; carrier: the seat.
  • feat(metadata): listPackageBindings reads an item's package from its stored row's package column #37187's N3 and N6 were not folded into this card and are untouched.
  • Reading, not measured end to end: the GET /meta/:type/:name/published overlay branch serves a stored row's own body, as round 4 read it; a snapshot nested in that body is served as stored.

Verification

Two-minute check: pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.platform-mark-rollback.test.ts src/protocol-history-slots.test.ts after building @objectstack/metadata; expect 6 and 17 passed, including the three [#37130] door pins and the two [#37130] selector refusals.

Local gates at abc706c

node scripts/pm/dispatch-gates.mjs --commands derived 72 commands; all 72 run, 70 exit 0 at abc706ce. Two exit 3 (prerequisite not met, NOT MEASURED; CI runs both): node scripts/check-plugin-teardown-shape.mjs --self-test (shallow clone), pnpm check:dual-build-cjs-loads (unbuilt packages outside this diff). pnpm check:type-check-debt re-run: exit 0. dispatch-gates --ran: "72 derived famil(ies) accounted for — 70 run, 2 NOT-MEASURED". overlap-check --pr=37387: merges cleanly with origin/main and #37387.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc

… whose row is the platform's own record

rollbackMetaItem and the restore limb of revertCommit ask the metadata
service's rollback refusal (refusePlatformRecordRestore, now exported by
@objectstack/metadata) on the row SysMetadataRepository.restoreVersion
writes: 409 RESOURCE_CONFLICT, nothing written; revertCommit reports the
item in failed[] and reverts the others. Pins per door plus a restart pin.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
…her holds nor ships the name never addresses the package-less row

historySlotOf counted the package-less row a read naming the package falls
back to as that package's slot whether or not it ships the name. It is now
the package's only when the package ships the name (ADR-0150 D4); any other
package is refused 409 not-held-by-qualifier, as the selector's description
states. The 33308 unit and dogfood fixtures that addressed the environment's
slot through a non-shipping package are retargeted.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
…column is listed once, under its column

The boot priming pass filed a stored row's body under its body's _packageId
stamp while the row loader keys the row by its package column, so list()
listed the row twice. register() with skipSourceLoader now files such a
body under the column's slot, so a primed process answers as an unprimed
one does.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
… reads no column, and a node that finds a legacy row bound answers the bound column

N2: a datasource: loader without loadRowBindings makes the answer degraded,
naming the loader, instead of an undegraded registration binding.
N7: bindReadRowPackage records the column as its re-read finds it, so the
node whose boot pass lost the race to bind a legacy row answers the bound
package rather than null until restart.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
…or refuse what they answered before

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/metadata-protocol, @objectstack/metadata, touching 12 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/metadata/src/index.ts, packages/metadata/src/package-slotted-store.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via MetadataManager (symbol, a top-level class))
  • content/docs/deployment/cli.mdx (via /packages/:id/commits/:commitId/revert (route, the route ledger binds it to client method packages.revertCommit))
  • content/docs/kernel/cluster.mdx (via MetadataManager (symbol, a top-level class))
  • content/docs/kernel/contracts/metadata-service.mdx (via listPackageBindings (symbol, a method of class MetadataManager))
  • content/docs/plugins/adding-a-metadata-type.mdx (via MetadataManager (symbol, a top-level class))
  • content/docs/protocol/kernel/metadata-service.mdx (via MetadataManager (symbol, a top-level class))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/implementation-status.mdx (via MetadataManager (symbol, a top-level class))
  • content/docs/releases/v17/17-0.mdx (via MetadataManager (symbol, a top-level class))
  • content/docs/releases/v18/18-1.mdx (via revertCommit (symbol, a method of class ProtocolPackageCommitsFacet))
  • content/docs/releases/v18/18-5.mdx (via MetadataManager (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/metadata/src/index.ts, packages/metadata/src/package-slotted-store.ts) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 17 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ee11fce924ee0be609807738a3e0770cf6c396a3 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from ad2cc02da96ea9fe63c8c2a4f8705f605e0f3d81 — the merge of head 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63 into base ee11fce924ee0be609807738a3e0770cf6c396a3, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ad2cc02da96ea9fe63c8c2a4f8705f605e0f3d81 && git checkout ad2cc02da96ea9fe63c8c2a4f8705f605e0f3d81
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ee11fce924ee0be609807738a3e0770cf6c396a3 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63 && git checkout -B drift-repro ee11fce924ee0be609807738a3e0770cf6c396a3 && git merge --no-ff 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63

node scripts/docs-audit/affected-docs.mjs --json ee11fce924ee0be609807738a3e0770cf6c396a3

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs ee11fce924ee0be609807738a3e0770cf6c396a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ee with the code, and restoreVersion's option sits under its package

The unreleased #37013 note named only `rollback` as refusing the platform's
own record and said the protocol's restore doors store every body without
the mark; all three restore doors refuse it and the protocol's doors strip
it from every other restore. Its snapshot sentence now uses the wording of
PLATFORM_PROVENANCE's doc. The #37130 note lists restoreVersion's
refusePlatformRecord option under @objectstack/metadata-protocol, where
SysMetadataRepository ships.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud#1 · os-warren · session_01JQwxba3jmfHtmkWfFXfVTc

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63
Local-runs: none
Scope: packages/metadata-protocol/src/protocol-history-slots.ts, packages/metadata-protocol/src/protocol-package-commits.ts, packages/metadata-protocol/src/sys-metadata-repository.ts, packages/metadata/src/index.ts, packages/metadata/src/loaders/database-loader.ts, packages/metadata/src/metadata-manager.ts, packages/metadata/src/package-slotted-store.ts, packages/metadata-protocol/src/protocol-diff-history-slots.33308.test.ts, packages/metadata-protocol/src/protocol-history-slots.test.ts, packages/metadata-protocol/src/protocol.platform-mark-rollback.test.ts, packages/metadata/src/loaders/database-loader.test.ts, packages/qa/dogfood/test/history-diff-two-holders-33308.dogfood.test.ts, .changeset/37130-platform-record-restore-doors.md, .changeset/37013-platform-skill-own-slot.md + packages/metadata-protocol/src/protocol-authoring-gate.ts, packages/metadata-protocol/src/protocol-class-head.ts, packages/metadata-protocol/src/batch-object-registration.ts, packages/metadata-protocol/src/protocol-history-and-publish.ts, packages/metadata-protocol/src/protocol-save.ts, packages/metadata-protocol/src/protocol-diff-delete-load.ts, packages/metadata-protocol/src/protocol-package-commit-record.ts, packages/metadata-protocol/src/index.ts, packages/metadata-core/src/objects/sys-metadata-commit.object.ts, packages/spec/src/api/protocol.zod.ts, packages/spec/src/contracts/metadata-service.ts
Security-touching: no
Rule-change-verified: none

Face: narrowing (Clause-②: yes (narrowing) on the PR body and on .changeset/37130-platform-record-restore-doors.md; no published schema and no governed path in the 14-file list, none under .claude/**). Inputs: card #37130 with its six comments, PR #37423 (body, file list, net diff against main at merge base ecbe854b), and the check-runs on the head. The review began on abc706ce; the head then moved to 43a6758f. I read git diff abc706ce..43a6758f myself: two files, both under .changeset/, 6 insertions and 2 deletions, so every code and test hunk judged below is byte-identical on this head. The seat's note that moved the head also named the changeset correction as a duty; its two claims (a changeset-only delta, and a Check Changeset red that is the deliberate-correction class) were checked against the tree and the job log, not adopted.

① Derived judgments

Accept-set and public-surface changes the diff implies, each judged:

  1. rollbackMetaItem refuses a restore whose active row is the platform's own record: 409 RESOURCE_CONFLICT, nothing written (protocol-package-commits.ts:2268, judged at sys-metadata-repository.ts:2026 on the row the same call then writes). Right: card item 1, the service door's own refusal function.
  2. The restore limb of revertCommit refuses the same row per item, into failed[] with code: RESOURCE_CONFLICT, and the commit's other items still revert (protocol-package-commits.ts:1732; the per-item catch pushes to failed[], and revertPlan.push sits after restoreVersion, so a refused item is not in the revert's own commit). Right: ADR-0067 D3 as amended runs per item.
  3. The history, diff and rollback ?package= selector refuses a package that neither holds a row of the name nor ships it, also when the package-less row is stored (protocol-history-slots.ts:206-210). Right, and it is the spec's own refusal made real: HISTORY_PACKAGE_SELECTOR_DESCRIPTION (packages/spec/src/api/protocol.zod.ts:2727, unchanged on main) already says "a package that neither holds nor ships the name is refused 409 not-held-by-qualifier". What is taken away is a behaviour that description contradicted; the description needs no edit, since a shipper still addresses the package-less row.
  4. Public surface added: refusePlatformRecordRestore exported from @objectstack/metadata (packages/metadata/src/index.ts), and the optional refusePlatformRecord option of SysMetadataRepository.restoreVersion (the class is exported at packages/metadata-protocol/src/index.ts:246). Right: additive, default off, no caller changes behaviour without passing it. The private refusePlatformRecordRollback it replaces was never exported, so nothing is removed.
  5. The refusal's message gains one clause; code and status are unchanged. Right as to the envelope; the clause is N1.
  6. MetadataManager.list() after the boot priming pass lists a row whose body stamp differs from its column once, under the column (primedRowSlot, metadata-manager.ts:1911); a read naming the stamp's package no longer answers the primed copy. Right: it is what an unprimed process over the same rows answers, and the new pin holds a cold-manager control.
  7. listPackageBindings answers degraded: true, naming the loader, over a datasource: loader with no loadRowBindings. Right: packages/spec/src/contracts/metadata-service.ts:463 already tells a gating consumer to treat a degraded answer as unknown, so no contract text moves. DatabaseLoader is the only datasource: loader in the tree and offers the method.
  8. bindReadRowPackage records the column the re-read finds; the node that lost the first-boot race answers the bound package, not null. Right, and no query is added: the re-read predates the hunk.
  9. No schema key, accepted value, error code, refusal reason or route is added: RESOURCE_CONFLICT and not-held-by-qualifier both exist. Metadata-protocol: none is right.
  10. Three expectations are inverted to the 409 the ruling states (one unit case, its 33308 twin, one dogfood case). Right: each pinned the branch card item 2 removes.

Gate verdicts, read as check-run conclusions on 43a6758f at record time: every run has concluded (read 2026-11-26T04:20Z, head unchanged). Success: Build Core, Test Core and all ten of its shards, Type Check · workspace, Type Check · source gates, Type Check · consumer gates, Type Check · debt ledger, TypeScript Type Check, Dogfood Regression Gate, Live E2E UI, Test UI, Lint & Repo Gates with its eight Lint · jobs, Spec property liveness, Governed Surface Queue Guard, PR-body guards, Check PR Size, Plan Test Core shards, Flag docs affected by code changes, Auto Label, filter. Failure: Check Changeset, both runs, for the single reason judged in ② (the deliberate correction of a pending note); its level, ADR-0087 and major-bump lines pass. Eighteen runs are skipped (UI build and opt-in families this diff does not select). The dev's two local NOT MEASURED families are answered by these runs.

② Semver level

.changeset/37130-platform-record-restore-doors.md: patch on @objectstack/metadata and @objectstack/metadata-protocol, Clause-②: yes (narrowing), Metadata-protocol: none, a BREAKING banner with a "What to do" line under each breaking bullet, and one ADR-0087 marker (not-required (no-migration-prescription)). Right. AGENTS.md Post-Task step 3 sets the level by the metadata-protocol kind alone, and a non-protocol breaking change ships patch with its banner and disposition; nothing an author can write is added, refused or re-meant here. The Check Changeset job prints the same reading on this head: "LEVEL AXIS: this PR declares clause-② yes (narrowing) and metadata-protocol none ... a non-protocol change at patch", and "1 declared-breaking changeset(s), each carrying an ADR-0087 disposition". yes in place of the claim's no is right: the diff adds public surface (① item 4).

The new section "Also in @objectstack/metadata-protocol" of that note reads: "SysMetadataRepository.restoreVersion takes refusePlatformRecord: true to ask refusePlatformRecordRestore (@objectstack/metadata) on the row it writes; the undo writes do not pass it." Right, sentence by sentence: the option is declared at sys-metadata-repository.ts:1952; it is asked on activeRow, the row put then updates; and neither undo write passes it (batch-object-registration.ts:351, protocol-history-and-publish.ts:162). Moving it out of the @objectstack/metadata list is right, since the class ships from the other package. The bullet left under @objectstack/metadata ("refusePlatformRecordRestore(type, name, row) is exported: the one refusal the service's rollback and the protocol's two restore doors ask") is right: database-loader.ts:1932 and sys-metadata-repository.ts:2026 call the one function.

Deliberate correction of a pending note: .changeset/37013-platform-skill-own-slot.md. Check Changeset is red on this head in both of its runs for exactly one reason, the check-empty-changeset refusal that this file "exists on the merge base and was not added by this PR"; every other line of the job is a pass. The PR body declares the correction under "Deliberate correction" and names the note. git diff abc706ce..43a6758f shows one line of that file changed, in three places, with the frontmatter and the rest of the bullet untouched. Per .claude/skills/pm-dispatch/references/landing-operations.md, this record judges each rewritten sentence against the tree, before and after:

  • Strip sentence. Before: "... and so do the metadata protocol's save door and its restore doors (rollbackMetaItem and the restore limb of revertCommit); a stored row the boot pass re-registers keeps it only when the row held it as read." After: "... and so do the metadata protocol's save door and its restore doors (rollbackMetaItem and the restore limb of revertCommit) on every restore whose row is not the platform's own record; a stored row ...". On main the Before was true of every restore (the door pins were red there because the platform's row was written back). On this head a restore over the platform's row writes nothing, so the Before over-states and the After is exact: the strip is withoutPlatformOrigin in restoredBodyWriter (protocol-authoring-gate.ts:135), which both doors receive through restoreWriteFor, and the refusal precedes the write. Right.
  • Refusal sentence. Before: "rollback whose row is the platform's own record is refused (409 RESOURCE_CONFLICT, naming the fix), with nothing written." After: "A restore whose row is the platform's own record is refused (409 RESOURCE_CONFLICT, naming the fix), with nothing written, at all three restore doors: rollback, and the metadata protocol's rollbackMetaItem and the restore limb of revertCommit." The Before named one door of three on this head. The After matches database-loader.ts:1932, protocol-package-commits.ts:2268 and :1732. At revertCommit the refusal is per item, in failed[], which the 37130 note states beside it. Right.
  • getPublished sentence. Before: "getPublished serves it on the answer's top level only when the stored item carries it there, and never inside a publish snapshot;" After: "getPublished serves it on the answer's top level only when the stored item carries it there (the platform's own record's publish snapshot, served as the answer, keeps the mark it carries at its top), and never on a snapshot nested inside the answer;". The code is the same on main and on this head (metadata-manager.ts:3612, withoutServedPlatformMarks at :742): the answer is the item's publishedDefinition when it has one, keepTop is carriesPlatformStamp(item), and only a publishedDefinition nested in the answer is always stripped. So the Before was already inexact when it merged (a snapshot served as the answer can keep the mark), and the After is exact. Right. One note on the PR body's framing: this PR did not make that third sentence false, it was imprecise before; that is a wording matter of the PR body only and is folded into N4.
  • "of a failed batch row write", left unchanged on purpose: no longer the exact wording, and it was not exact before either. undoBatchRowWrite undoes a row whose write landed and whose registration the registry then refused (settleBatchObjectRows, batch-object-registration.ts; both callers' messages say "the registry refuses it"). A write that failed leaves nothing to undo. The same diff corrects this phrase in the code (PLATFORM_PROVENANCE: "the undo of a batch row the registry refused (undoBatchRowWrite)"), so the code doc and the pending note now differ. Graded N3.

The correction is confirmed for the three rewritten sentences.

③ Boundary flags

Open question (the export and the option without a maintainer decision): on the design, option A is right and I find no fork. (a) It is an additive export of a refusal the producer already shipped privately (refusePlatformRecordRollback), from the entry that since #37013 exports the mark's one definition to the same consumer (PLATFORM_PROVENANCE, carriesPlatformStamp, isPlatformOrigin, withoutPlatformOrigin, beside historyRowAttribution). (b) The card rules "the same prescription as the service's rollback"; option B is a second copy of code, status and sentence in metadata-protocol, which is the drift the card closes. (c) The option is optional and off by default, and the two undo writes stay byte for byte. (d) No error code, reason value, schema key or route is added.

On the route, two texts govern and I read them together. .claude/agents/os-dev.md (the stop section) has a change to a published export reported as needs_decision; pm-dispatch SKILL.md's escalation frame lands a new export name that has a producer precedent under the veto window, with the seat naming the precedent. A new export is not a change to a published one, so the second text governs the export, and its precedent is (a). The optional option on the already-published restoreVersion is nearer the first text's letter, though it is additive and changes no existing call. The dev reported done and asked, where the stricter reading would have stopped first: a process note for the seat, not rework. Answer: acceptable without a decision card, provided the seat's ACCEPT names both additions and the precedent so the maintainer's veto window covers them. This record does not rule in the maintainer's place; if the seat reads the option under the first text, it goes to him, and nothing in this review depends on which.

Deviations:

  • Clause-②: yes (narrowing) where the claim read no (narrowing): right, see ②.
  • The dogfood file outside the claim's surface, and its unit twin, retargeted to the 409: accepted. Both pinned the removed branch and would be red otherwise; the edit is the minimum, and the surviving branch (a shipper addressing the package-less row) keeps its unit pin through shippers: [BETA].
  • PR body stale on three readings at abc706ce: the body on this head carries the re-run figures. One line is stale again, N4.
  • Two local gate families NOT MEASURED: CI answers them; see the gate verdicts in ①.

Carriers the report names, each answered:

SQL push-down: no finding. No hunk adds a query, an id materialisation or an in-app join. restoreVersion judges the activeRow it already read, bindReadRowPackage reuses its existing re-read, historySlotOf asks the same two reads as before, and primedRowSlot and the listPackageBindings branch are in memory.

Security line: no. No hunk teaches permission, sharing, credential, token or authentication behaviour. The refusals apply to every caller alike and address which row a door writes or reads; degraded is a completeness signal.

Read outside the diff, not reviewed, for the seat: adoptOrphans (protocol-package-commits.ts, the orphan filter near line 897) rebinds every package-less row that is not artifact-backed by its column alone, and I found no exclusion of the platform's own record there. Read, not measured. If it holds, an adopted platform row keeps the mark under a package's column, and N5 applies to it.

④ Design judgment

No must-fix, no should-fix.

The narrowing against the published spec on main: it makes the spec's own refusal real (① item 3) and takes no declared capability away. The restore refusal is new behaviour the card rules, at doors whose spec text names no platform record.

Per file, against the card and the cited code:

  • sys-metadata-repository.ts: holds. The check sits after the read of the row the write addresses and before put, so "judged on the row it writes, before anything is written" is true sentence by sentence. Earlier refusals of the same call (VERSION_NOT_FOUND, the tombstone, a refused body) can answer first; each also writes nothing.
  • protocol-package-commits.ts: holds. Both doors always state packageId, so the row judged is the row restored. Tried: bare rollback of a platform-only name (refused); ?package= of a shipper falling back to the platform's row (slot null, refused here or at the package-less close before it); ?package= of a non-shipper (refused earlier by item 2); the two undo writes (unchanged, they are the only other restoreVersion callers); rollbackToPackageCommit (goes through revertCommit).
  • protocol-history-slots.ts: holds. The only branch that changes is slot === null with a package that does not ship the name. A package's own row, its .custom pair's declared override, the unserved-row branch, and the row-held-base recursion (the base holds a row when the bare door asks) all answer as before.
  • database-loader.ts: holds. registerRollback asks the same predicate on the same row as before; the function is the old one with the row test moved inside. The storedRowBodyOf comment sits on its function. N7's record is taken only for a legacy row the read handed out.
  • metadata-manager.ts: holds. primedRowSlot answers only for a body a row loader handed out (readRowColumnOf), on the boot pass (skipSourceLoader, whose one caller is plugin.ts:1821), with a filled column and a different stamp; every other write keeps the write rule's key. The unstamped-body sentence agrees with withEntryPackage, which stamps a body that names no package with its entry's.
  • package-slotted-store.ts: holds. Each sentence of the reworded PLATFORM_PROVENANCE doc matches the code: the strip list, the three refusing doors, the two undo writes by what they undo, and the snapshot rule.
  • index.ts: holds.
  • The five test files: the pins assert the refusal, the unchanged row and the surviving item; the selector pins assert reason, caller and candidates; the list(), N2 and N7 pins carry a control or an exact write count. Their red-on-base and ablation counts are the dev's reading, not re-run here.

Nits (none changes correctness or the contract):

  • N1 (nit) — the prescription's new clause, "to make an earlier version the environment's own item of the name, save that version's body again" (database-loader.ts, repeated in the 37130 note), names a route whose result lasts until the platform's next registration: the pending 37013 note states that a package-less environment write under a platform name "takes the bare slot without the stamp, and the platform's next registration restores its record". The same message says the platform registers again at its next boot, so a reader can infer it, but the clause does not say it.
  • N2 (nit) — the revertCommit door pin and the RESTART pin serve a commit row with no package_id. recordPackageCommit (protocol-package-commit-record.ts:56, packageId: string) is the only writer of that table, and the limb's own comment says it never writes the package-less row. With a commit that names its package the limb reads that package's row, which the platform's package-less record is not. The pins do go red without the line, and the earlier 技能元数据:平台注册的技能要能与同名应用技能并存,平台写入和撤回不碰应用的槽位 #37013 pin in this file uses the same harness shape; but the acceptance's restart pin rides this door, not rollbackMetaItem, where the scenario is reachable through a bare rollback, and the note's "Before, both doors wrote the version back" holds for revertCommit only on such a row.
  • N3 (nit) — "of a failed batch row write" in .changeset/37013-platform-skill-own-slot.md, see ②.
  • N4 (nit) — the PR body's "Acceptance notes" still say the 37013 note "still carries ... 'never inside a publish snapshot'" and is "outside this claim's file surface", beside a "Deliberate correction" section that rewrites it; and that section says the PR made the note false, which is true of two of its three sentences. PR-body prose only.
  • N5 (nit) — refusePlatformRecordRestore reads the mark off the row's body alone, while the protocol's own reader of the same fact, isPlatformRecordRow (protocol-diff-delete-load.ts:1867), also requires an empty package column. They agree on every row the current doors write. On a package-bound row whose body keeps the mark and names no package they differ, and the refusal would then prescribe naming the package the caller already named.

Implemented-by: claude/project-thread-fyj895
Reviewed-by: session_01JQwxba3jmfHtmkWfFXfVTc (an isolated sub-agent of this session, read-only; the dispatch order was not an input)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud#1 · os-warren · session_01JQwxba3jmfHtmkWfFXfVTc

席位核对

ACCEPT · head 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63 · Area: cloud zone · read 2026-11-26T04:22Z

Checklist (l1-review-checklist.md). The mechanical items come from l1-face.mjs --pr 37423 at this head, and all are ok:

  • shape;
  • first line Fixes #37130, with no closing keyword on any other card;
  • no releases path;
  • the changeset covers both published packages (@objectstack/metadata, @objectstack/metadata-protocol, patch);
  • declarations Clause-②: yes (narrowing) · Metadata-protocol: none;
  • floor checks Lint & Repo Gates and TypeScript Type Check are success.

Checks at this head: 38 success, 18 expected skip, and 2 failed. Both failures are Check Changeset, red by design (below). check-governed-merges.mjs --pr 37423: NOT governed, 410 lines ≤ 3000.

  • Fixes is right. Card amendment 7147761520 lists what stays open, and the diff delivers it:

    • item 1: both protocol restore doors refuse the platform's own record through the one refusePlatformRecordRestore that the service's rollback asks, and revertCommit puts the refused item in failed[] (ADR-0067 D3 as amended);
    • item 2: the historySlotOf holdsSlot line;
    • item 3: the code nits.

    The ADR-0010 note is the one line outside this PR's surface. carrier: the weekly ADR revisions card, with the wording the PR body gives. R16 was re-verified on the tree with no code change: the four getPublished pins already exist in database-loader.test.ts. The folded follow-ups from 7180250767 are each fixed and pinned: (a) primedRowSlot, (b) N2 degraded, (c) N7 column record.

  • Sentence reads (owed by face). I read both changesets against the code at this head.

    • .changeset/37130-platform-record-restore-doors.md: each bullet matches the diff. The restoreVersion option now sits under @objectstack/metadata-protocol.
    • .changeset/37013-platform-skill-own-slot.md is a pending note that this PR rewrites, a DELIBERATE CORRECTION. The PR body's "Deliberate correction" section names the note and quotes the three sentences before and after. The same-head CONTRACT_REVIEW_TIER record, comment 7182526807, judges each rewritten sentence right in its ②. That record is the confirmation landing-operations.md asks for, because this PR changes code. The check-empty-changeset red at this head is that class and nothing else: the job log's only ##[error] names that note.
  • Tests. The PR body and report 7182042115 record real runs: @objectstack/metadata 83 files / 2808 passed, and @objectstack/metadata-protocol 370 files / 23440 passed. Eight ablations each went red, and the new door pins were red on base 5bf7242 with the quoted assertions.

  • L2. Narrowing face at CONTRACT_REVIEW_TIER: PASS on this head, No must-fix, no should-fix., five nits (comment 7182526807). Adopted: an isolated sub-agent at that tier, which never saw this seat's conclusions. Its Scope: covers every non-prose path of the diff, plus the cited files it read.

  • Open question (dev report): the export refusePlatformRecordRestore and the optional restoreVersion option refusePlatformRecord. Seat's call: A, keep both. There is precedent for each, so the maintainer's veto window applies rather than a decision card (SKILL.md 〈升级与决策〉):

    No error code or reason value is added: RESOURCE_CONFLICT and not-held-by-qualifier both exist.

Accepted deviations:

  • The claim (comment 7180818366) read Clause-②: no (narrowing). The diff also adds the export above, so the PR declares yes (narrowing). The diff decides, and the at-tier L2 PASS covers both arms.
  • packages/qa/dogfood/test/history-diff-two-holders-33308.dogfood.test.ts is outside the claimed surface. It pinned the branch that item 2 rules out, and now expects the 409. Its unit twin was retargeted the same way.
  • The L2 nits are not fixed here, because each would move the head:
    • N1: the prescription's "save that version's body again" lasts only until the platform's next registration;
    • N2: the revertCommit and RESTART pins use a commit row with no package_id;
    • N3: "of a failed batch row write" in the 37013 note;
    • N4: the PR body's acceptance notes predate the correction;
    • N5: the body-only mark read vs isPlatformRecordRow's empty-column test.
  • N2 (feat(metadata): listPackageBindings reads an item's package from its stored row's package column #37187's follow-up b) adds a cause of degraded that the listPackageBindings docblock and content/docs/kernel/contracts/metadata-service.mdx do not enumerate. It falls under their existing "a row loader whose rows could not be read" reading, and the consumer rule (treat degraded as unknown) is unchanged.

Follow-ups. carrier: the area:cloud zone; none are filed here.

Landing: owed the full dogfood battery on this head (the title has ! and the declaration a (narrowing) arm). The abc706c run (4128 passed) does not pin 43a6758, so the dev is re-running the battery on this head. The PR lands after that report, per landing-operations.md B. The red Check Changeset goes into the queue under SKILL.md's three conditions, with the confirmation above.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud#1 · os-warren · session_01JQwxba3jmfHtmkWfFXfVTc

Landing 2026-11-26T05:18Z · head 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63 · ACCEPT 7182545383 · L2 PASS 7182526807

probe reading
checks at head (pr-state.mjs) 38 success · 18 expected skip · Check Changeset red by design: the DELIBERATE CORRECTION of .changeset/37013-platform-skill-own-slot.md, which the same-head L2 record confirms
landing-k.mjs K = 10 < 15; no locale or shared-budget leg
dogfood battery 43a6758f · VERDICT command-exit 0 · 4128 passed, 0 failed (report 7183349622)
governed NOT governed, 410 lines ≤ 3000

State: ready + auto-merge. On MERGED, Fixes #37130 closes the card and pm:dispatched comes off.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 05:18
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as draft November 26, 2026 05:35
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud#1 · os-warren · session_01JQwxba3jmfHtmkWfFXfVTc

维护者速读

  • 用户能看到什么变化:环境管理员在历史版本里恢复或整批撤销时,平台自带的技能等记录不再被改回旧版本,而是收到冲突提示和处理办法。按应用查看历史时,既没存过也不提供该名称的应用会被拒绝。
  • 为什么做:这是「平台技能与应用技能分开存放」的收尾,补上协议层的两个恢复入口;同一读取链上的三处小问题也一起修了。
  • 出错会怎样:最坏情况是本该成功的恢复被误拒,提示冲突但什么都不写;改动可以整体撤回。
  • 要你做什么:这个 PR 申报了收窄(Clause-②: yes (narrowing))。按 2026-11-19 的裁定,它要由维护者落地:请 os-zhuang 在 GitHub 上 Approve 现 head 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63。合并队列的 Governed Surface Guard 在 2026-11-26T05:20Z 因缺这个批准把它踢出了队列。

Contract review PASS: comment 7182526807, Head-sha: 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63, CONTRACT_REVIEW_TIER. ACCEPT: 7182545383. Dogfood at head: 7183349622. The PR goes back to draft until the approval lands, and then the seat re-arms it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 26, 2026 05:37
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 8e1e15b Nov 26, 2026
62 of 65 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-fyj895 branch November 26, 2026 06:08
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

元数据平台标记收尾:已发布读取只按顶层标记、平台自己的记录回滚保留标记

3 participants